package com.cloud.mall.pms.service;

import com.cloud.mall.api.CommonPage;
import com.cloud.mall.base.BaseResponse;
import com.cloud.mall.pms.dto.PmsBrandParam;
import com.cloud.mall.pms.dto.PmsProductAttributeParam;
import com.cloud.mall.pms.dto.ProductAttrInfo;
import com.cloud.mall.pms.out.PmsBrandOut;
import com.cloud.mall.pms.out.PmsProductAttributeOut;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "商品属性管理")
@RequestMapping("/productAttribute")
public interface PmsProductAttributeService {

    @ApiOperation("添加商品属性信息")
    @PostMapping("/create")
    BaseResponse create(@RequestBody PmsProductAttributeParam productAttributeParam);

    @ApiOperation("修改商品属性信息")
    @PostMapping("/update/{id}")
    BaseResponse update(@PathVariable("id") Long id, @RequestBody PmsProductAttributeParam productAttributeParam);

    @ApiOperation(value = "根据编号查询品牌信息")
    @GetMapping("/{id}")
    BaseResponse<PmsProductAttributeOut> getItem(@PathVariable("id") Long id);

    @ApiOperation(value = "批量删除商品属性")
    @PostMapping("/delete/batch")
    BaseResponse deleteBatch(@RequestParam("ids") List<Long> ids);

    @ApiOperation("根据商品分类的id获取商品属性及属性分类")
    @GetMapping("/attrInfo/{productCategoryId}")
    BaseResponse<List<ProductAttrInfo>> getAttrInfo(@PathVariable Long productCategoryId);

    @ApiOperation("根据分类查询属性列表或参数列表")
    @GetMapping("/list/{cid}")
    BaseResponse<CommonPage<PmsProductAttributeOut>> getList(@PathVariable Long cid,
                                                                 @RequestParam(value = "type") Integer type,
                                                                 @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                                 @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum);

}
